package com.crm.business.admin.log;


import com.crm.business.admin.service.IAdminRoleService;
import com.crm.common.admin.entity.PO.AdminRole;
import com.crm.common.ka.core.common.log.BehaviorEnum;
import com.crm.common.ka.core.common.log.Content;
import com.crm.common.utils.spring.SpringUtils;

public class AdminRoleLog {
    private IAdminRoleService adminRoleService = SpringUtils.getBean(IAdminRoleService.class);

    public Content delete(Integer roleId) {
        AdminRole adminRole = adminRoleService.getById(roleId);
        return new Content(adminRole.getRoleName(),"删除了角色:"+adminRole.getRoleName(), BehaviorEnum.DELETE);
    }

    public Content copy(Integer roleId) {
        AdminRole adminRole = adminRoleService.getById(roleId);
        return new Content(adminRole.getRoleName(),"复制了角色:"+adminRole.getRoleName(), BehaviorEnum.COPY);
    }

    public Content deleteWorkRole(Integer roleId) {
        AdminRole adminRole = adminRoleService.getById(roleId);
        return new Content(adminRole.getRoleName(),"删除了项目角色:"+adminRole.getRoleName(), BehaviorEnum.DELETE);
    }
}
